#ifndef POINTPOSITIONING_H
#define POINTPOSITIONING_H

#include "GNSSSatPos.h"
#include "ReadN.h"
#include "ReadO.h"
#include "Matrix.h"
#include "TimeSys.h"
#include "CoordSys.h"
#include "LonosphereCorrection.h"
#include "TroposphereCorrection.h"

// 导航数据类型定义
typedef std::vector<BroadEphemeris> NavData;

class PointPositioning {
public:
    PointPositioning();
    ~PointPositioning();

    // 单点定位计算
    XYZ calculatePosition(const obsEpoch& obsData, const NavData& navData, const XYZ& approxPos);

private:
    // 计算卫星位置
    std::vector<XYZ> calculateSatellitePositions(const obsEpoch& obsData, const NavData& navData);
    
    // 计算几何距离
    Matrix calculateGeometryMatrix(const XYZ& receiverPos, const std::vector<XYZ>& satPositions);
    
    // 计算误差改正
    Matrix calculateErrorCorrections(const obsEpoch& obsData, const XYZ& receiverPos, const std::vector<XYZ>& satPositions);
};

#endif // POINTPOSITIONING_H